//
//  BCApplicationInfoSectionHeaderView.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2019/1/16.
//  Copyright © 2019 guoshikeji. All rights reserved.
//

#import "BCApplicationInfoSectionHeaderView.h"

@interface BCApplicationInfoSectionHeaderView ()

@property (nonatomic, strong) QMUILabel *titleLabel;

@end

@implementation BCApplicationInfoSectionHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self setupSubviews];
    }
    return self;
}

- (void)setupSubviews {
    self.titleLabel = [QMUILabel new];
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView).offset(15.0);
        make.centerY.mas_equalTo(self.contentView);
        make.right.mas_equalTo(self.contentView).offset(-15.0);
    }];
}

- (void)setViewModel:(BCApplicationInfoViewModel *)viewModel {
    _viewModel = viewModel;
    //
    self.titleLabel.text = BCLocalizedKey(viewModel.sectionTitleKey);
}

+ (CGFloat)defaultHeight {
    return 35.0f;
}

@end
